home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" version="1.0"
- xmlns="http://www.w3.org/TR/REC-html40"
- xmlns:local="#local-functions">
-
- <xsl:param name="imageDir" select="'sdimages'"/>
- <xsl:param name="schemaName" select="' '"/>
-
-
- <xsl:output method="html" indent="no"/>
- <xsl:strip-space elements="*"/>
- <xsl:template match="/">
- <html>
- <head>
- <title>SchemaDOC - <xsl:value-of select="$schemaName"/> </title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
-
- <style type="text/css">
- <!-- container for expanding/collapsing content -->
- .c {cursor:hand}
-
- <!-- button - contains +/-/nbsp -->
- .b {color:red; font-family:'Courier New'; font-weight:bold; text-decoration:none}
-
- <!-- element container -->
- .e {margin-left:1em; text-indent:-1em; margin-right:1em}
-
- <!-- comment or cdata -->
- .k {margin-left:1em; text-indent:-1em; margin-right:1em}
-
- <!-- tag -->
- .t {color:#000066}
-
- <!-- elementtype +eleemnt-->
- .et {color:#0000FF}
-
- <!-- xdr default element attributes-->
- .xdra {color:#006600}
-
- <!-- tag in xsl namespace -->
- .xt {color:#990099}
-
- <!-- attribute in xml or xmlns namespace -->
- .ns {color:red}
-
- <!-- markup characters -->
- .m {color:blue}
-
- <!-- text node -->
- .tx {font-weight:bold}
-
- <!-- multi-line (block) cdata -->
- .db {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px; padding-left:.3em; border-left:1px solid #CCCCCC; font:small Courier}
-
- <!-- single-line (inline) cdata -->
- .di {font:small Courier}
-
- <!-- DOCTYPE declaration -->
- .d {color:blue}
-
- <!-- pi -->
- .pi {color:blue}
-
- <!-- multi-line (block) comment -->
- .cb {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px; padding-left:.3em; font:small Courier; color:#888888}
-
- <!-- single-line (inline) comment -->
- .ci {font:small Courier; color:#888888} PRE {margin:0px; display:inline} h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18pt; color: #000000} .heading { text-align:right;} .content { vertical-align: baseline; } .note { color:gray;}
-
- .names {font-family:' Arial, Helvetica'; font-weight:bold; font-size:12 }
- .source {font-family:'Courier New'; font-size:12 }
- .values {font-family:'Verdana, Arial, Helvetica'; font-size:12 }
- .headers {font-family:'Verdana, Arial, Helvetica'; font-weight:bold; font-size:12 }
- .descriptions {font-family:'Courier New'; color:redfont-size:12 }
-
-
- </style>
- <SCRIPT type="text/javascript">
- <xsl:comment>
- <![CDATA[
- // Detect and switch the display of CDATA and comments from an inline view
- // to a block view if the comment or CDATA is multi-line.
- function f(e)
- {
- // if this element is an inline comment, and contains more than a single
- // line, turn it into a block comment.
- if (e.className == "ci") {
- if (e.children(0).innerText.indexOf("\n") > 0)
- fix(e, "cb");
- }
-
- // if this element is an inline cdata, and contains more than a single
- // line, turn it into a block cdata.
- if (e.className == "di") {
- if (e.children(0).innerText.indexOf("\n") > 0)
- fix(e, "db");
- }
-
- // remove the id since we only used it for cleanup
- e.id = "";
- }
-
- // Fix up the element as a "block" display and enable expand/collapse on it
- function fix(e, cl)
- {
- // change the class name and display value
- e.className = cl;
- e.style.display = "block";
-
- // mark the comment or cdata display as a expandable container
- j = e.parentElement.children(0);
- j.className = "c";
-
- // find the +/- symbol and make it visible - the dummy link enables tabbing
- k = j.children(0);
- k.style.visibility = "visible";
- k.href = "#";
- }
-
- // Change the +/- symbol and hide the children. This function works on "element"
- // displays
- function ch(e)
- {
- // find the +/- symbol
- mark = e.children(0).children(0);
-
- // if it is already collapsed, expand it by showing the children
- if (mark.innerText == "+")
- {
- mark.innerText = "-";
- for (var i = 1; i < e.children.length; i++)
- e.children(i).style.display = "block";
- }
-
- // if it is expanded, collapse it by hiding the children
- else if (mark.innerText == "-")
- {
- mark.innerText = "+";
- for (var i = 1; i < e.children.length; i++)
- e.children(i).style.display="none";
- }
- }
-
- // Change the +/- symbol and hide the children. This function work on "comment"
- // and "cdata" displays
- function ch2(e)
- {
- // find the +/- symbol, and the "PRE" element that contains the content
- mark = e.children(0).children(0);
- contents = e.children(1);
-
- // if it is already collapsed, expand it by showing the children
- if (mark.innerText == "+")
- {
- mark.innerText = "-";
- // restore the correct "block"/"inline" display type to the PRE
- if (contents.className == "db" || contents.className == "cb")
- contents.style.display = "block";
- else contents.style.display = "inline";
- }
-
- // if it is expanded, collapse it by hiding the children
- else if (mark.innerText == "-")
- {
- mark.innerText = "+";
- contents.style.display = "none";
- }
- }
-
- // Handle a mouse click
- function cl()
- {
- e = window.event.srcElement;
-
- // make sure we are handling clicks upon expandable container elements
- if (e.className != "c")
- {
- e = e.parentElement;
- if (e.className != "c")
- {
- return;
- }
- }
- e = e.parentElement;
-
- // call the correct funtion to change the collapse/expand state and display
- if (e.className == "e")
- ch(e);
- if (e.className == "k")
- ch2(e);
- }
-
- // Erase bogus link info from the status window
- function h()
- {
- window.status=" ";
- }
-
- // Set the onclick handler
- document.onclick = cl;
-
- ]]>
- //
- </xsl:comment>
- </SCRIPT>
-
- </head>
- <body bgcolor="#FFFFFF" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0">
- <xsl:apply-templates/>
- <center>
- <table border="0" WIDTH="90%" BGCOLOR="#eeeeee" >
- <tr>
- <td>
- <xsl:apply-templates mode="copy"/>
- </td>
- </tr>
- </table>
- </center>
-
- </body>
- </html>
- </xsl:template>
- <xsl:template match="schema">
- <table width="90%" border="0" cellspacing="4" cellpadding="2" align="center">
- <tr >
- <td bgcolor="#003366" colspan="2" >
- <font face="Arial,Helvetica" size="5" color="#FFFFFF">
-
- XML Schema -
- <xsl:apply-templates mode="prefix" select="." />
- <xsl:if test="@uri">
- :
- <xsl:value-of select="@uri"/> -
- </xsl:if>
- <xsl:value-of select="$schemaName"/>
- </font>
- </td>
- </tr>
- <xsl:if test="intro | comment">
- <tr >
- <td width="20%" class="headers" bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
- Schema Comments:
- </td>
- <td class="descriptions" align="left" bgcolor="#EEEEEE" fgcolor="#FFAA00" valign="top">
- <font color="#990000">
- <xsl:apply-templates mode="comments" select="./intro | ./comment"/></font>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="@namespace">
- <tr >
- <td width="20%" class="headers" bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
- namespace
- </td>
- <td class="descriptions" align="left" bgcolor="#EEEEEE" fgcolor="#FFAA00" valign="top">
- <xsl:value-of select="@namespace"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="@version">
- <tr >
- <td width="20%" class="headers" bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
- version
- </td>
- <td class="descriptions" align="left" bgcolor="#EEEEEE" fgcolor="#FFAA00" valign="top">
- <xsl:value-of select="@version"/>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="./join">
- <tr >
- <td width="20%" class="headers" bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
- other schemas used
- </td>
- <td class="descriptions" align="left" bgcolor="#EEEEEE" fgcolor="#FFAA00" valign="top">
- <xsl:for-each select="./join/@system">
- <xsl:value-of select="."/>,
- </xsl:for-each>
- </td>
- </tr>
- </xsl:if>
-
- <tr>
- <td width="20%" class="headers" bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
- <div class="headers">Schema has:</div>
- </td>
- <td class="values" bgcolor="eeeeee" align="left" valign="top">
- <xsl:number value="count(elementtype)"/>
- element definitions and
- <xsl:number value="count(attdef)"/>
- element attribute definitions and
- <xsl:number value=" count(datatype)"/>
- datatype definitions.
-
- </td>
- </tr>
-
- <tr>
- <td width="20%" class="headers" bgcolor="#CCCCCC" align="right" valign="top" wrap="true">
- Posible root elements:
- </td>
- <td class="values" bgcolor="eeeeee" align="left" valign="top">
- <xsl:for-each select="elementtype">
- <xsl:sort select="@name"/>
- <xsl:choose>
- <!-- Look for root elements -->
- <xsl:when test="/*[not(.//element[@type=current()/@name])]">
- <B>
- <
- <A>
- <xsl:attribute name="href">#ELEMENT_<xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:value-of select="@name"/>
- </A>
- >
- </B>
- <xsl:choose>
- <xsl:when test=".//element">†</xsl:when>
- <xsl:otherwise>(orphan?)</xsl:otherwise>
- </xsl:choose>
- <xsl:if test="(position()+1) mod 3 = 1">
- <br/>
- </xsl:if>
-
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </td>
- </tr>
- </table>
- <p/>
- <p/> <p/>
- <table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
- <tr >
- <td bgcolor="#003366" >
- <font face="Arial,Helvetica" size="5" color="#FFFFFF">
- Element list
- </font>
- </td>
- </tr>
- </table>
- <p/>
- <xsl:apply-templates mode="anElement" select="elementtype"/>
- <p/> <p/>
- <table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
- <tr >
- <td bgcolor="#003366" >
- <font face="Arial,Helvetica" size="5" color="#FFFFFF">
- DataType definitions
- </font>
- </td>
- </tr>
- </table>
- <p/>
- <xsl:apply-templates mode="datatypeDefs" select=".//datatype"/>
- <p/> <p/>
-
- <P/>
- <P/>
- <P/>
- <table width="90%" border="0" cellspacing="0" cellpadding="2" align="center">
- <tr>
- <td bgcolor="#bbbbbb" >
- <font face="Arial,Helvetica" size="5" color="#FFFFFF">
- <xsl:if test="@name">
- <xsl:value-of select="@name"/>
- </xsl:if>
- Original Schema Source
- </font>
- </td>
- </tr>
- </table>
- </xsl:template>
- <!--END s:schema***********************************************************-->
- <!--END s:schema***********************************************************-->
- <xsl:template mode="anElement" match="elementtype">
- <center>
- <table width="90%" cellspacing="0" cellpadding="2" border="0" >
- <tr bgcolor="#003366">
- <td>
- <font face="Arial,Helvetica" color="#FFFFFF">
- Element
- <A>
- <xsl:attribute name="name">ELEMENT_<xsl:value-of select="@name"/>
- </xsl:attribute>
- <b>
- <xsl:value-of select="@name"/>
- </b>
- </A>
- </font>
- </td>
- </tr>
- </table>
- </center>
- <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
- <tr>
- <td width="3%" bgcolor="#4444FF" align="left" valign="middle">†</td>
- <td width="97%" align="left" valign="top">
- <table width="100%" cellspacing="3" cellpadding="1" border="0" bordercolor="#FFFFFF" align="left">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- diagram
- </td>
- <td align="left" valign="top" bgcolor="#eeeeeeee" >
- <img>
- <xsl:attribute name="SRC"><xsl:value-of select="$imageDir"/>/<xsl:value-of select="@name"/>.gif
- </xsl:attribute>
- </img>
- </td>
- </tr>
- <xsl:if test="explain">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- description
- </td>
- <td width="85%" class="descriptions" align="left" bgcolor="#eeeeeeee" wrap="true">
- <font color="#990000">
- <xsl:apply-templates mode="schemacomments" select=".//explain"/></font>
- </td>
- </tr>
- </xsl:if>
-
- <xsl:if test="extends">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- extends
- </td>
- <td width="85%" class="values" bgcolor="#eeeeeeee">
- <xsl:apply-templates mode="extends" select="extends"/>
- </td>
- </tr>
- </xsl:if>
-
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- attributes
- </td>
- <td width="85%" class="values" bgcolor="#eeeeeeee">
- <xsl:choose>
- <xsl:when test=".//attdef">
- <xsl:apply-templates mode="glanceAttrib" select=".//attdef"/>
- </xsl:when>
- <xsl:otherwise>
- none
- </xsl:otherwise>
- </xsl:choose> </td>
- </tr>
-
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- uses
- </td>
- <xsl:if test="model">
- <td width="85%" class="values" bgcolor="#eeeeeeee"> <xsl:apply-templates mode="uses" select=".//element" />
- </td>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="extends//element">
- <td width="85%" class="values" bgcolor="#eeeeeeee">
- <xsl:apply-templates mode="uses" select="extends//element" />
- and posible others from the supertype <xsl:apply-templates mode="extends" select="extends"/>
- </td>
- </xsl:when>
- <xsl:when test="extends">
- <td width="85%" class="values" bgcolor="#eeeeeeee">
- <xsl:apply-templates mode="uses" select="extends//element" />
- see <xsl:apply-templates mode="extends" select="extends"/>
- </td>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="any">
- <td width="85%" class="values" bgcolor="#eeeeeeee">any mix of string content and know elements is permited
- </td>
- </xsl:if>
- <xsl:if test="empty">
- <td width="85%" class="values" bgcolor="#eeeeeeee">content is not permited
- </td>
- </xsl:if>
-
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
- <tr>
- <td width="3%" bgcolor="#6666FF" align="center" valign="top">†</td>
- <td width="97%" align="center" valign="left">
- <table width="100%" cellspacing="3" cellpadding="1" border="0" align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
- <!-- Find the parents -->
- <TR>
- <TD width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">used by</TD>
- <TD class="values" bgcolor="#eeeeee" align="left" valign="top">
- <xsl:choose>
- <xsl:when test="../elementtype[.//element[@type = current()/@name ]]">
- <xsl:for-each select="../elementtype[.//element[@type = current()/@name ]]">
-
- <xsl:sort select="@name"/>
- <A class="element-link">
- <xsl:attribute name="HREF">
- #ELEMENT_
- <xsl:value-of select="@name"/>
- </xsl:attribute>
- <xsl:value-of select="@name"/>
- </A>
- †
- <xsl:if test="current()[position()!=last()]">,</xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test=".//model">
- <SPAN class="note">No parents found. This a most likely a document element that can stand be created.</SPAN>
- </xsl:when>
- <xsl:otherwise>
- <SPAN class="note">No parents found. This probably an orphan.</SPAN>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </TD>
- </TR>
-
- <!-- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- content
- </td>
- <td width="85%" class="values" bgcolor="#eeeeeeee">
-
-
-
- </td>
- </tr>
- -->
- <tr>
- <td width="15%" bgcolor="#CCCCCC" align="right" valign="top">
- <span class="names">content model</span>
- </td>
- <td width="85%" class="values" bgcolor="#eeeeee" >
- <xsl:choose>
- <xsl:when test="empty">
- empty
- </xsl:when>
- <xsl:when test="extends">
- inherits from <xsl:value-of select="extends/@type"/>
- </xsl:when>
- <xsl:when test="model">
- <xsl:apply-templates mode="content" select="model"/>
- </xsl:when>
- <xsl:otherwise>
- string
- </xsl:otherwise>
- </xsl:choose>
-
- </td>
- </tr>
-
- </table>
- </td>
- </tr>
- </table>
- <xsl:if test=".//attdef">
- <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
- <tr>
- <td width="3%" bgcolor="#8888FF" align="left" valign="top">†</td>
- <td width="97%" align="left" valign="top">
- <table width="100%" cellspacing="3" cellpadding="1" border="0" align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
- <tr>
- <th width="15%" bgcolor="#CCCCCC" align="right" valign="top">
- <span class="headers">Attribute</span>
- </th>
- <th width="20%" bgcolor="#CCCCCC" align="left" >
- <span class="headers">Datatype</span>
- </th>
- <th width="20%" bgcolor="#CCCCCC" align="left" >
- <span class="headers">Presence</span>
- </th>
- <th width="25%" bgcolor="#CCCCCC" align="left" >
- <span class="headers">Values</span>
- </th>
- <th width="20%" bgcolor="#CCCCCC" align="left" >
- <span class="headers">Default</span>
- </th>
-
- </tr>
- <xsl:apply-templates mode="detailAttrib" select=".//attdef"/>
- </table>
- </td>
- </tr>
- </table>
- </xsl:if>
- <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
- <tr>
- <td width="3%" bgcolor="#bbbbbb" align="left" valign="top">†</td>
- <td width="97%" align="left" valign="top">
- <table width="100%" cellspacing="3" cellpadding="1" border="0" align="left" valign="top" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
-
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- source
- </td>
- <td width="85%" class="source" bgcolor="#eeeeeeee" align="left" valign="top">
- <xsl:apply-templates mode="copy" select="current()"/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <p/>
- </xsl:template>
-
- <xsl:template mode="glanceAttrib" match="attdef">
- <xsl:value-of select="@name"/>
- </xsl:template>
-
- <xsl:template mode="detailAttrib" match="attdef">
- <tr>
- <td width="15%" bgcolor="#CCCCCC" align="right" valign="top">
- <span class="headers">
- <b>
- <xsl:value-of select="@name"/>
- </b>
- </span>
- </td>
- <td width="20%" class="values" bgcolor="#eeeeee" align="left" valign="top">
- <A ><xsl:attribute name="href">http://apps.xmlschema.com/schemaDoc/soxref.htm#datatype_<xsl:value-of select="@datatype"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="@datatype">
- <xsl:value-of select="@datatype"/>
- </xsl:when>
- <xsl:when test="enumeration">
- enumeration (<xsl:value-of select="./enumeration/@datatype"/>)
- </xsl:when>
- <xsl:otherwise>
- string(default)
- </xsl:otherwise>
- </xsl:choose>
- </A>
- </td>
- <td width="20%" class="values" bgcolor="#eeeeee" align="left" valign="top">
- <xsl:choose>
- <xsl:when test="required">
- required
- </xsl:when>
- <xsl:when test="implied">
- implied
- </xsl:when>
- <xsl:when test="default">
- default
- </xsl:when>
- <xsl:when test="fixed">
- fixed
- </xsl:when>
- <xsl:otherwise>
- implied <i> default </i>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- <td width="25%" class="values" bgcolor="#eeeeee" align="left" valign="top">
-
- <xsl:for-each select=".//option">
- <xsl:value-of select="." />
- </xsl:for-each>
- </td>
-
- <td width="20%" class="values" bgcolor="#eeeeee" align="left" valign="top">
-
- <xsl:value-of select="default"/>
- </td>
- </tr>
- </xsl:template>
-
-
- <!-- END detailattributetype TYPE -->
-
- <xsl:template mode="anElement" match="element">
- <A><xsl:attribute name="HREF">#ELEMENT_<xsl:value-of select="@type"/></xsl:attribute><xsl:value-of select="@type"/>
- </A>
- </xsl:template>
-
- <xsl:template match="explain" mode="schemacomments">
- <xsl:apply-templates mode="comments" />
- </xsl:template>
-
- <xsl:template match="explain" mode="usagecomments">
- <xsl:choose>
- <xsl:when test="@usage='USAGE'">
- <xsl:value-of select="text()"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template mode="prefix" match="*">
- <xsl:if test="@prefix">
- <font color="#00ff00"> <xsl:value-of select="@prefix"/>:</font>
- </xsl:if>
- </xsl:template>
-
- <xsl:template mode="uses" match="element">
-
- <xsl:apply-templates mode="prefix" select="." />
-
- <A><xsl:attribute name="HREF">#ELEMENT_<xsl:value-of select="@type"/>
- </xsl:attribute>
- <xsl:value-of select="@type"/>
- </A>
- <xsl:if test="@occurs">
- (<xsl:value-of select="@occurs"/>)
- </xsl:if>
-
- <xsl:if test="@name">
- [<xsl:value-of select="@name"/>]
- </xsl:if>
- <xsl:if test="position()!=last()">, </xsl:if>
- </xsl:template>
- <!--
- <xsl:template mode="uses" match="append">
- <A><xsl:attribute name="HREF">#ELEMENT_<xsl:value-of select="./element/@type"/>
- </xsl:attribute>
- <xsl:value-of select="./element/@type"/>
- </A>
- <xsl:if test="./element/@name">
- [<xsl:value-of select="./element/@name"/>]
- </xsl:if>
-
- <xsl:if test="position()!=last()">, </xsl:if>
-
- </xsl:template>
- -->
- <xsl:template mode="content" match="model">
-
- <xsl:if test="string">
- <xsl:choose>
- <xsl:when test="./string/@datatype">
- a string of the datatype <xsl:value-of select="./string/@datatype" />
- </xsl:when>
- <xsl:otherwise>
- content that may be specialized by datatype (string)
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:if>
- <xsl:if test="element">uses one element (element)</xsl:if>
- <xsl:if test="mixed">any mix of string content and named elements (mixed)</xsl:if>
- <xsl:if test="choice">one of the subelements (choice) </xsl:if>
- <xsl:if test="sequence">two or more subelements(sequence)</xsl:if>
- <xsl:if test="paramref">parameter reference(paramref)</xsl:if>
- </xsl:template>
-
-
-
-
-
- <xsl:template match="explain" mode="comments">
- <xsl:copy>
- <xsl:apply-templates mode="comments" />
- </xsl:copy>
- </xsl:template>
- <xsl:template match="extends" mode="extends">
- <xsl:apply-templates mode="prefix" select="." />
- <A><xsl:attribute name="HREF">#ELEMENT_<xsl:value-of select="@type"/>
- </xsl:attribute>
- <xsl:value-of select="@type"/>
- </A>
- </xsl:template>
-
- <xsl:template mode="datatypeDefs" match="datatype" >
- <center>
- <table width="90%" cellspacing="0" cellpadding="2" border="0" >
- <tr bgcolor="#AAAAFF">
- <td>
- <font face="Arial,Helvetica" color="#FFFFFF">
- Datatype
- <A>
- <xsl:attribute name="name">DATATYPE_<xsl:value-of select="@name"/>
- </xsl:attribute>
- <b>
- <xsl:value-of select="@name"/>
- </b>
- </A>
- </font>
- </td>
- </tr>
- </table>
- <table width="90%" cellspacing="0" cellpadding="0" border="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" align="center">
- <tr>
- <td width="3%" bgcolor="#AAAAFF" align="left" valign="middle">†</td>
- <td width="97%" align="left" valign="top">
-
- <table width="100%" cellspacing="3" cellpadding="1" border="0" bordercolor="#FFFFFF" align="left">
-
-
- <xsl:if test="/explain">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- description
- </td>
- <td width="85%" class="descriptions" align="left" bgcolor="#eeeeeeee" wrap="true">
- <font color="#990000">
- <xsl:apply-templates mode="schemacomments" select=".//explain"/></font>
- </td>
- </tr>
- </xsl:if>
-
- <xsl:if test="enumeration">
- <xsl:apply-templates mode="enumdt" select="enumeration" />
- </xsl:if>
- <xsl:if test="scalar">
- <xsl:apply-templates mode="scalardt" select="scalar" />
- </xsl:if>
- <xsl:if test="varchar">
- <xsl:apply-templates mode="varchardt" select="varchar" />
- </xsl:if>
-
- </table>
- </td>
- </tr>
- </table>
-
- </center>
- <p/>
- </xsl:template> <!--datatypes -->
-
- <xsl:template mode="enumdt" match="enumeration">
-
- <xsl:if test="@datatype">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- base type
- </td>
- <td width="85%" class="values" align="left" bgcolor="#eeeeeeee" wrap="true">
- <xsl:value-of select="@datatype" />
- </td>
- </tr>
- </xsl:if>
-
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- values
- </td>
- <td width="85%" class="values" align="left" bgcolor="#eeeeeeee" wrap="true">
- <xsl:for-each select="./option">
- <xsl:value-of select="." />
- <xsl:if test="position()!=last()"> | </xsl:if>
- </xsl:for-each>
-
- </td>
- </tr>
-
- </xsl:template> <!--enumeration dt -->
-
- <xsl:template mode="scalardt" match="scalar">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- base type
- </td>
- <td width="85%" class="values" align="left" bgcolor="#eeeeeeee" wrap="true">
- <xsl:choose>
- <xsl:when test="@datatype">
-
- <xsl:value-of select="@datatype" />
- </xsl:when>
- <xsl:otherwise>
- number <i> (default) </i>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
-
- <xsl:if test="@prefix">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- prefix
- </td>
- <td width="85%" class="values" align="left" bgcolor="#eeeeeeee" wrap="true">
- <xsl:value-of select="@prefix" />
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="@digits">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- digits
- </td>
- <td width="85%" class="values" align="left" bgcolor="#eeeeeeee" wrap="true">
- <xsl:value-of select="@digits" />
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="@decimals">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- decimals
- </td>
- <td width="85%" class="values" align="left" bgcolor="#eeeeeeee" wrap="true">
- <xsl:value-of select="@decimals" />
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="@minexclusive | @maxexclusive | @minvalue | maxvalue">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- range
- </td>
- <td width="85%" class="values" align="left" bgcolor="#eeeeeeee" wrap="true">
- <xsl:choose>
- <xsl:when test="@minexclusive='true'">
- (
- </xsl:when>
- <xsl:otherwise>
- [
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@minvalue">
- <xsl:value-of select="@minvalue" />,
- </xsl:when>
- <xsl:otherwise>
- *,
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@maxvalue">
- <xsl:value-of select="@maxvalue" />
- </xsl:when>
- <xsl:otherwise>
- *
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@maxexclusive='true'">
- )
- </xsl:when>
- <xsl:otherwise>
- ]
- </xsl:otherwise>
- </xsl:choose>
-
- </td>
- </tr>
- </xsl:if>
-
-
- </xsl:template> <!--scalar dt -->
-
- <xsl:template mode="varchardt" match="varchar">
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- base type
- </td>
- <td width="85%" class="values" align="left" bgcolor="#eeeeeeee" wrap="true">
- <xsl:choose>
- <xsl:when test="@datatype">
- <xsl:value-of select="@datatype" />
- </xsl:when>
- <xsl:otherwise>
- string <i> (default) </i>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <tr>
- <td width="15%" class="names" bgcolor="#CCCCCC" align="right" valign="top">
- maxlength
- </td>
- <td width="85%" class="values" align="left" bgcolor="#eeeeeeee" wrap="true">
- <xsl:value-of select="@maxlength" />
- </td>
- </tr>
-
- </xsl:template> <!--varchar dt -->
- <!-- ***********************SOURCE part...copied from lotus*****************-->
-
- <!-- Templates for each node type follows. The output of each template has a similar structure
- to enable script to walk the result tree easily for handling user interaction. -->
-
- <!-- Template for pis not handled elsewhere -->
- <xsl:template mode="copy" match="processing-instruction()">
- <DIV class="e">
- <SPAN class="b"> </SPAN>
- <SPAN class="m"><?</SPAN><SPAN class="pi"><xsl:value-of select="name(.)"/> <xsl:value-of select="."/></SPAN><SPAN class="m">?></SPAN>
- </DIV>
- </xsl:template>
-
- <!-- Template for the XML declaration. Need a separate template because the pseudo-attributes
- are actually exposed as attributes instead of just element content, as in other pis
- <xsl:template mode="copy" match="processing-instruction('xml')">
- <DIV class="e">
- <SPAN class="b"> </SPAN>
- <SPAN class="m"><?</SPAN><SPAN class="pi">xml <xsl:for-each select="@*"><xsl:value-of select="name(.)"/>="<xsl:value-of select="."/>" </xsl:for-each></SPAN><SPAN class="m">?></SPAN>
- </DIV>
- </xsl:template>
- -->
-
- <!-- Template for attributes not handled elsewhere -->
- <xsl:template mode="copy" match="@*"><SPAN class="t"><xsl:text> </xsl:text><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
-
- <!-- Template for attributes in the xmlns or xml namespace
- <xsl:template mode="copy"match="@xmlns:*|@xmlns|@xml:*"><SPAN class="ns"> <xsl:value-of select="name(.)"/></SPAN><SPAN class="m">="</SPAN><B class="ns"><xsl:value-of select="."/></B><SPAN class="m">"</SPAN></xsl:template>
- -->
-
- <!-- Template for text nodes -->
- <xsl:template mode="copy" match="text()">
- <xsl:choose><xsl:when test="name(.) = '#cdata-section'"><xsl:call-template name="cdata"/></xsl:when>
- <xsl:otherwise><DIV class="e">
- <SPAN class="b"> </SPAN>
- <SPAN class="tx"><xsl:value-of select="."/></SPAN>
- </DIV></xsl:otherwise></xsl:choose>
- </xsl:template>
-
- <!-- Template for comment nodes -->
- <xsl:template mode="copy" match="comment()">
- <DIV class="k">
- <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m"><!--</SPAN></SPAN>
- <SPAN id="clean" class="ci"><PRE><xsl:value-of select="."/></PRE></SPAN>
- <SPAN class="b"> </SPAN> <SPAN class="m">--></SPAN>
- <SCRIPT>f(clean);</SCRIPT></DIV>
- </xsl:template>
-
- <!-- Template for cdata nodes -->
- <xsl:template name="cdata">
- <DIV class="k">
- <SPAN><A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> <SPAN class="m"><![CDATA[</SPAN></SPAN>
- <SPAN id="clean" class="di"><PRE><xsl:value-of select="."/></PRE></SPAN>
- <SPAN class="b"> </SPAN> <SPAN class="m">]]></SPAN>
- <SCRIPT>f(clean);</SCRIPT></DIV>
- </xsl:template>
-
- <!-- Template for elements not handled elsewhere (leaf nodes) -->
- <xsl:template mode="copy" match="*">
- <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
- <SPAN class="b"> </SPAN>
- <SPAN class="m"><</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN> <xsl:apply-templates mode="copy" select="@*"/><SPAN class="m"> /></SPAN>
- </DIV></DIV>
- </xsl:template>
-
- <!-- Template for elements with comment, pi and/or cdata children
- <xsl:template mode="copy" match="*[comment() or processing-instruction() or cdata()]">
- <DIV class="e">
- <DIV class="c"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m"><</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates mode="copy" select="@*"/> <SPAN class="m">></SPAN></DIV>
- <DIV><xsl:apply-templates mode="copy" />
- <DIV><SPAN class="b"> </SPAN> <SPAN class="m"></</SPAN><SPAN><xsl:attribute name="class"><xsl:if test="xsl:*">x</xsl:if>t</xsl:attribute><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN></DIV>
- </DIV></DIV>
- </xsl:template> -->
-
- <!-- Template for elements with only text children -->
- <xsl:template mode="copy" match="*[text() and not(comment() or processing-instruction() or *)]">
- <DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
- <SPAN class="b"> </SPAN> <SPAN class="m"><</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates mode="copy" select="@*"/>
- <SPAN class="m">></SPAN><SPAN class="tx"><xsl:value-of select="."/></SPAN><SPAN class="m"></</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN>
- </DIV></DIV>
- </xsl:template>
-
- <!-- Template for elements with element children -->
- <xsl:template mode="copy" match="*[*]">
- <DIV class="e">
- <DIV class="c" STYLE="margin-left:1em;text-indent:-2em"><A href="#" onclick="return false" onfocus="h()" class="b">-</A> <SPAN class="m"><</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><xsl:apply-templates mode="copy" select="@*"/><SPAN class="m">></SPAN></DIV>
- <DIV><xsl:apply-templates mode="copy" />
- <DIV><SPAN class="b"> </SPAN><SPAN class="m"></</SPAN><SPAN class="t"><xsl:value-of select="name(.)"/></SPAN><SPAN class="m">></SPAN></DIV>
- </DIV></DIV>
- </xsl:template>
- function writeEnumeration(_contextNodeList)
- {
- var __this = _contextNodeList.item(0);
- return formatEnum(__this, __this.selectSingleNode("../@default"));
- }
-
- </xsl:stylesheet>
-